package com.xiguthings.waka.service.usershare.impl;

import com.xiguthings.waka.dao.mapper.UserShareMapper;
import com.xiguthings.waka.po.UserCoolDownCard;
import com.xiguthings.waka.po.UserCoolDownCardExample;
import com.xiguthings.waka.po.UserShare;
import com.xiguthings.waka.po.UserShareExample;
import com.xiguthings.waka.po.extpo.Page;
import com.xiguthings.waka.publicUtils.StringUtils;
import com.xiguthings.waka.service.userCDcard.IUserCDcardService;
import com.xiguthings.waka.service.usershare.IUserShareService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;

@Service
@Transactional
public class UserShareServiceImpl implements IUserShareService {

    @Resource
    private UserShareMapper userShareMapper;

    @Override
    @Transactional(propagation = Propagation.NOT_SUPPORTED)
    public int countByExample(UserShareExample userShareExample) throws Exception {
        return userShareMapper.countByExample(userShareExample);
    }

    @Override
    @Transactional(readOnly = false, isolation = Isolation.DEFAULT, propagation = Propagation.REQUIRED)
    public int deleteByExample(UserShareExample userShareExample) throws Exception {
        int row = userShareMapper.deleteByExample(userShareExample);
        return row;
    }

    @Override
    @Transactional(readOnly = false, isolation = Isolation.DEFAULT, propagation = Propagation.REQUIRED)
    public int deleteByPrimaryKey(String id) throws Exception {
        return 0;
    }

    @Override
    @Transactional(readOnly = false, isolation = Isolation.DEFAULT, propagation = Propagation.REQUIRED)
    public int insert(UserShare userShare) throws Exception {
        String id = StringUtils.getRandomUUID();
        userShare.setUserShareId(id);
        userShare.setCreateTime(new Date());

        return userShareMapper.insert(userShare);
    }

    @Override
    @Transactional(readOnly = false, isolation = Isolation.DEFAULT, propagation = Propagation.REQUIRED)
    public int insertSelective(UserShare userShare) throws Exception {
        return 0;
    }

    @Override
    @Transactional(propagation = Propagation.NOT_SUPPORTED)
    public List<UserShare> selectByExample(UserShareExample userShareExample) throws Exception {
        return null;
    }

    @Override
    @Transactional(propagation = Propagation.NOT_SUPPORTED)
    public UserShare selectByPrimaryKey(String id) throws Exception {
        return null;
    }

    @Override
    @Transactional(readOnly = false, isolation = Isolation.DEFAULT, propagation = Propagation.REQUIRED)
    public int updateByExampleSelective(UserShare userShare, UserShareExample userShareExample) throws Exception {
        return 0;
    }

    @Override
    @Transactional(readOnly = false, isolation = Isolation.DEFAULT, propagation = Propagation.REQUIRED)
    public int updateByExample(UserShare userShare, UserShareExample userShareExample) throws Exception {
        return 0;
    }

    @Override
    @Transactional(readOnly = false, isolation = Isolation.DEFAULT, propagation = Propagation.REQUIRED)
    public int updateByPrimaryKeySelective(UserShare userShare) throws Exception {
        return 0;
    }

    @Override
    public int updateByPrimaryKey(UserShare userShare) throws Exception {
        return 0;
    }

    @Override
    @Transactional(propagation = Propagation.NOT_SUPPORTED)
    public Page selectByPage(Page pageEntity, UserShareExample userShareExample) throws Exception {
        return null;
    }
}
